<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: GamedayUtil</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">GamedayUtil</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/lib/gameday_util_rb.html">
                lib/gameday_util.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
This class provides a variety of utility methods that are used in other
classes
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000137">convert_digit_to_string</a>&nbsp;&nbsp;
      <a href="#M000140">get_connection</a>&nbsp;&nbsp;
      <a href="#M000144">is_date_valid</a>&nbsp;&nbsp;
      <a href="#M000141">net_http</a>&nbsp;&nbsp;
      <a href="#M000136">parse_date_string</a>&nbsp;&nbsp;
      <a href="#M000138">parse_gameday_id</a>&nbsp;&nbsp;
      <a href="#M000139">read_config</a>&nbsp;&nbsp;
      <a href="#M000142">read_file</a>&nbsp;&nbsp;
      <a href="#M000143">save_file</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000137" class="method-detail">
        <a name="M000137"></a>

        <div class="method-heading">
          <a href="GamedayUtil.src/M000137.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayUtil.src/M000137.html');return false;">
          <span class="method-name">convert_digit_to_string</span><span class="method-args">(digit)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Converts a digit into a 2 character string, prepended with &#8216;0&#8217;
if necessary
</p>
        </div>
      </div>

      <div id="method-M000140" class="method-detail">
        <a name="M000140"></a>

        <div class="method-heading">
          <a href="GamedayUtil.src/M000140.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayUtil.src/M000140.html');return false;">
          <span class="method-name">get_connection</span><span class="method-args">(url)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000144" class="method-detail">
        <a name="M000144"></a>

        <div class="method-heading">
          <a href="GamedayUtil.src/M000144.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayUtil.src/M000144.html');return false;">
          <span class="method-name">is_date_valid</span><span class="method-args">(month, date)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000141" class="method-detail">
        <a name="M000141"></a>

        <div class="method-heading">
          <a href="GamedayUtil.src/M000141.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayUtil.src/M000141.html');return false;">
          <span class="method-name">net_http</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000136" class="method-detail">
        <a name="M000136"></a>

        <div class="method-heading">
          <a href="GamedayUtil.src/M000136.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayUtil.src/M000136.html');return false;">
          <span class="method-name">parse_date_string</span><span class="method-args">(date)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Parses a string with the date format of YYYYMMDD into an array with the
following elements:
</p>
<pre>
   [0] = year
   [1] = month
   [2] = day
</pre>
        </div>
      </div>

      <div id="method-M000138" class="method-detail">
        <a name="M000138"></a>

        <div class="method-heading">
          <a href="GamedayUtil.src/M000138.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayUtil.src/M000138.html');return false;">
          <span class="method-name">parse_gameday_id</span><span class="method-args">(gameday_gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Example gameday_gid = gid_2009_06_21_milmlb_detmlb_1
</p>
        </div>
      </div>

      <div id="method-M000139" class="method-detail">
        <a name="M000139"></a>

        <div class="method-heading">
          <a href="GamedayUtil.src/M000139.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayUtil.src/M000139.html');return false;">
          <span class="method-name">read_config</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Read configuration from gameday_config.yml file to create instance
configuration variables.
</p>
        </div>
      </div>

      <div id="method-M000142" class="method-detail">
        <a name="M000142"></a>

        <div class="method-heading">
          <a href="GamedayUtil.src/M000142.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayUtil.src/M000142.html');return false;">
          <span class="method-name">read_file</span><span class="method-args">(filename)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000143" class="method-detail">
        <a name="M000143"></a>

        <div class="method-heading">
          <a href="GamedayUtil.src/M000143.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayUtil.src/M000143.html');return false;">
          <span class="method-name">save_file</span><span class="method-args">(filename, data)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>